/**
 * 组织相关接口
 */

import http from "@/utils/request"

/**
 * 获取部门列表
 * @returns 
 */
export function getDepartmentAPI() {
    return http({
        url: "/company/department"
    })
}

/**
 * 获取部门负责人的数据
 * @returns 
 */

export function getManagerListAPI() {
    return http({
        url: '/sys/user/simple'
    })
}

/**
 * 新增部门
 * @param {*} data 
 * @returns 
 */
export function addDepartmentAPI(data) {
    return http({
        url: '/company/department',
        method: 'post',
        data
    })
}

/**
 * 获取部门详情
 * @param {*} id 
 * @returns 
 */
export function getDepartmentDetailAPI(id) {
    return http({
        url: `/company/department/${id}`,
    })
}

/**
 * 编辑部门
 * @param {*} data 
 * @returns 
 */
export function editDepartmentAPI(data) {
    return http({
        url: `/company/department/${data.id}`,
        method: "put",
        data
    })
}

/**
 * 删除部门
 * @param {*} id 
 * @returns 
 */
export function delDepartmentAPI(id) {
    return http({
        url: `/company/department/${id}`,
        method: "delete",
    })
}